package com.xuexi.mashibing;

public class OtherTest {
    public static void main(String[] args) {

        int[] a = {10, 11, 12, 13, 14, 15, 16, 17, 18};

        if (a.length % 2 == 0) {
            int min = a.length / 2 - 1;
            int max = a.length / 2;
            System.out.println((double) (a[min] + a[max]) / 2);
        } else {
            int middle = a.length / 2;
            System.out.println(a[middle]);
        }

    }
}
